<template>
  <div class="mt-10">
    <el-table :data="listData" style="width: 100%">
      <el-table-column align="center" label="序号" type="index" width="120">
      </el-table-column>
      <el-table-column align="center" label="测量ID" prop="id" width="162">
      </el-table-column>
      <el-table-column align="center" prop="name" label="测量名称">
      </el-table-column>
      <el-table-column align="center" prop="unit" label="测量单位">
      </el-table-column>
      <el-table-column
        align="center"
        prop="cTime"
        label="创建时间"
        :formatter="formatTime"
      >
      </el-table-column>
      <el-table-column
        align="center"
        prop="uTime"
        label="更新时间"
        :formatter="formatTime"
      >
      </el-table-column>
      <el-table-column align="center" prop="addSub" label="操作">
        <!-- 单元格的编辑和删除按钮 -->
        <template slot-scope="scope">
          <el-button
            type="primary"
            icon="el-icon-edit"
            circle
            @click="HanderEdit(scope.$index, scope.row)"
          ></el-button>
          <el-button
            type="danger"
            icon="el-icon-delete"
            circle
            @click="del(scope.$index)"
          ></el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },

  props: ["listData", "centerDialogVisible", "index"],
  methods: {
    HanderEdit(index, row) {
      this.$emit("edit", index, row);
    },
    del(index) {
      this.$emit("update:index", index);
      this.$emit("del");
    },
  },
};
</script>

<style>
</style>